import joblib
from sklearn.metrics import classification_report
import clean_data
import train_model
def load():
    a = clean_data.clean_data("./data/02初始测试集.csv")
    data = a.data
    contents, labels = data['x'], data['y']
    contents = a.tradition_tcc(contents)
    contents = a.speech_filter(contents)
    df = a.remove_null(contents, labels)
    a.save_csv(df, './data/04测试集.csv')

def predict():
    a = train_model.train_model('./data/04测试集.csv')
    data = a.data
    vectorizer = joblib.load('vectorizer.pkl')
    x = vectorizer.transform(data['x'])
    y = data['y']
    y_pre = a.model.predict(x)
    print(classification_report(y, y_pre))
# load()
